const Service = require('egg').Service;

class AddressService extends Service {
    async getList() {
        const {ctx,app}= this;
        const data = await app.mysql.select('address')
        return data;
    }
    async addList() {
        const {ctx,app}= this;
        const data = await app.mysql.insert('address', {...ctx.request.body})
        return data;
    }
    async editList() {
        const {ctx,app}= this;
        const data = await app.mysql.update('address', {...ctx.request.body})
        return data;
    }
    async delList() {
        const {ctx,app}= this;
        const data = await app.mysql.delete('address', {id:ctx.params.id})
        return data;
    }
}

module.exports = AddressService;
